package com.silence.demo.mapper;

import com.silence.demo.entity.DemoUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Created by Administrator on 2017/4/19.
 */
@Mapper
public interface DemoUserMapper {

    @Select("SELECT * FROM USER WHERE NAME = #{name}")
    DemoUser findByName(@Param("name") String name);

    @Insert("INSERT INTO USER(NAME, AGE) VALUES(#{name}, #{age})")
    int insert(@Param("name") String name, @Param("age") Integer age);

    void addUser(DemoUser user);
}
